package com.sh.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sh.dao.UseresourceDao;
import com.sh.entity.Rroom;
import com.sh.entity.Useresource;
import com.sh.util.Result;

@RestController
public class UseresourceController {
	@Autowired
	private UseresourceDao useresourceDao;
	
	@RequestMapping("/selectUseresourceDao")
	public Result getAll(Integer limit, Integer page, Useresource useresource, Map<String, Object> map) {
		map.put("page", (page - 1) * limit);
		map.put("limit", limit);
		map.put("tName", useresource.getoPeople());
		List<Map<String, Object>> getAlList = useresourceDao.getAll();
		Integer getInteger = useresourceDao.getCount();
		Result result = new Result(true, 0, null, getInteger, getAlList);
		return result;
	}
	@RequestMapping("/selectByRClass")
	public Result RClass(Useresource useresource,Map<String, Object> map) {
		map.put("rclass", useresource.getRclass());
		List<Map<String, Object>> getRclass = useresourceDao.getRclass(map);
		Integer getCount = useresourceDao.getCount();
		Result result = new Result(true, 0, null, getCount, getRclass);
		return result;
	}
	
	@RequestMapping("/selectses")
	public List getAlls() {
		List<Map<Object, Object>> getAlls = useresourceDao.getsAllSource();
		
		return getAlls;
	}
}
